﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Qreed.Windows.Forms;

namespace GotLyrics
{
    class AudioFileListView : ListView
    {
        /// <summary>
        /// Raises the <see cref="M:System.Windows.Forms.Control.CreateControl"/> method.
        /// </summary>
        protected override void OnCreateControl()
        {
            SystemImageList.AssignToListView(this);
            base.OnCreateControl();
        }

        public void SelectAllItems()
        {
            Focus();

            foreach (ListViewItem item in Items)
                item.Selected = true;
            
            /*if (Items.Count > 0)
            {
                //_doSelectionUpdate = false;

                //listView.
                // Cheap trick to select all items
                Focus();
                base.OnKeyDown(new KeyEventArgs(Keys.Home));
                //SendKeys.Send("{HOME}"); // Focus 1st item
                Focus();
                base.OnKeyDown(new KeyEventArgs(Keys.Space));
                //SendKeys.SendWait(" "); // Select first item
                Focus();

                
                base.OnKeyDown(new KeyEventArgs(Keys.End | Keys.Shift));
                //_doSelectionUpdate = true;

                //SendKeys.SendWait("+{END}"); // Select till end
            }*/
        }
    }
}
